#ifndef	DOBJAUXLIB_H
#define	DOBJAUXLIB_H

#include "dobj.h"
#include "mvect.h"

static	inline	int
vector_append_dobj(struct vector *vect, dobj_ptr_t o)
{
	dobj_ptr_t	*ptr;

	ptr = vector_append_obj(vect, sizeof(o));
	if (ptr == NULL) {
		return	(-1);
	}
	*ptr = o;

	return	(0);
}

static	inline	dobj_ptr_t
vector_pop_dobj(struct vector *vect)
{
	dobj_ptr_t	o;

	vect->vect_cur -= sizeof(o);
	o = *(dobj_ptr_t*)(vect->vect_base + vect->vect_cur);

	return	(o);
}

#endif	/* !DOBJAUXLIB_H */

